/*
 * Block.java
 * This file contains a representation of a track block in the track model of the CTCSS
 * Author: Daniel R Hartman
 * Date Created: 2012-11-22
 * Date Last Updated: 2012-11-26
 */

/**
 * This class represents a track block
 * @author Daniel R Hartman
 */
public class Block {

	int number, type, speedLimit, fail;
	String switchToNumber;
	double grade, length;
	boolean occupied, closed, underground;
	Block prev, next, switchTo;

	public Block(int n, double l, double g, int sl, boolean u, int t, String st){
		number = n;
		type = t;
		speedLimit = sl;
		fail = 0;
		switchToNumber = st;
		grade = g;
		length = l;
		occupied = false;
		closed = false;
		underground = u;
	}

	public Block(int n, double l, double g, int sl, boolean u, int t){
		number = n;
		type = t;
		speedLimit = sl;
		fail = 0;
		grade = g;
		length = l;
		occupied = false;
		closed = false;
		underground = u;
	}

	public void fail(int failure){
		fail = failure;
	}

	public void update(){

	}

	public String toString(){
			return (number + " " + type + " " + speedLimit + " " + length + " " + grade + " " + underground + " " + next.number + " " + switchToNumber);
	}

}